package com.moss.web;

import com.github.pagehelper.PageInfo;
import com.moss.common.core.BaseController;
import com.moss.common.domain.AjaxResult;
import com.moss.common.entity.SysNoticeEntity;
import com.moss.system.service.NoticeService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 通知公告控制器
 */
@RestController
@RequestMapping("notice")
public class NoticeController extends BaseController {


    @Resource
    NoticeService noticeService;


    @GetMapping("/list")
    public AjaxResult<List<SysNoticeEntity>> list(SysNoticeEntity notice){
        startPage();
        List<SysNoticeEntity> list = noticeService.selectList(notice);
        return AjaxResult.success(list,new PageInfo<>(list).getTotal());
    }
}
